[][src]Crate lyon_path

Data structures and traits to work with paths (vector graphics).

To build and consume paths, see the builder and iterator modules.

This crate is reexported in lyon.

Examples

use lyon_path::Path;
use lyon_path::math::{point};
use lyon_path::builder::*;

// Create a builder object to build the path.
let mut builder = Path::builder();

// Build a simple path.
let mut builder = Path::builder();
builder.move_to(point(0.0, 0.0));
builder.line_to(point(1.0, 2.0));
builder.line_to(point(2.0, 0.0));
builder.line_to(point(1.0, 1.0));
builder.close();

// Generate the actual path object.
let path = builder.build();

for event in &path {
    println!("{:?}", event);
}

Re-exports

pub use lyon_geom as geom;

Modules

builder

Tools to build path objects from a sequence of imperative commands.

iterator

Tools to iterate over paths.

math

Basic types that are used everywhere. Most other lyon crates reexport them.

Structs

ArcFlags

Flag parameters for arcs as described by the SVG specification.

Builder

Builds path object using the FlatPathBuilder interface.

Cursor

A cursor refers to an event within a Path.

Iter

An iterator for Path and PathSlice.

Path

A simple path data structure.

PathSlice

A view on a Path.

PathState

Represents the current state of a path while it is being built.

VertexId

A virtual vertex offset in a geometry.

Enums

FillRule

The fill rule defines how to determine what is inside and what is outside of the shape.

FlattenedEvent

Path event enum that can only present line segments.

PathEvent

Path event enum that represents all operations in absolute coordinates.

QuadraticEvent

Path event enum that can only present quadratic bézier curves and line segments.

SvgEvent

Path event enum that can represent all of SVG's path description syntax.

Functions

flattened_path_builder

FlattenedPathBuilder constructor.

reverse_path

Type Definitions

FlattenedPathBuilder

Builder for flattened paths

Index